#include <bits/stdc++.h>
#define ll long long
using namespace std;

const int Mod=1e9+7;
const int Maxn=1e5+6,N=1e5;
ll x,y;
ll f[Maxn];

int main(){
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout); 

	
	scanf("%lld%lld",&x,&y);
	if(y<=1e5){
		f[x]=1;
		for(int i=2;i<=y;i++){
			f[i]=(f[i]+f[i-1])%Mod;
			if(!(i&1)) f[i]=(f[i]+f[i/2])%Mod;
		}
		printf("%lld",f[y]);
	}

	return 0;
}

